package fr.upmc.aladyn.shared;

/**
 * Object class representing objects not tagged with the 
 * <code>Transactionable</code> annotation. While in a transaction phase, if one
 * of the accessed field is an object not presenting the 
 * <code>Transactionable</code> annotation, only it's reference 
 * will be saved. This means any modification to it's fields will not be 
 * rolled back.
 * 
 * @author Thierry Wong
 * @author Seyyid ahmed Ouir
 */

public class ObjetNonTrans 
{	
	private int myValue;
	private String myName;
	
	/**
	 * Creates an instance of <code>ObjetNonTrans</code>. It is <u>not</u> 
	 * tagged with the <code>Transactionable</code> annotation.
	 * 
	 * By default, it is named "Toto" and has a value of 0.
	 */
	public ObjetNonTrans()
	{
		this.myName = "Toto";
		this.myValue = 0;
	}
	
	/**
	 * Creates an instance of <code>ObjetNonTrans</code>. It is <u>not</u> 
	 * tagged with the <code>Transactionable</code> annotation. 
	 * 
	 * @param name Type <code>String</code> representing the name to be given 
	 * @param value Type <code>int</code> representing the value to be given
	 */
	public ObjetNonTrans(String name, int value)
	{
		this.myName = name;
		this.myValue = value;
	}
	
	
	/**
	 * Returns the value contained in this instance of 
	 * <code>ObjetNonTrans</code> 
	 * 
	 * @return Type <code> int</code>  representing the value of the object
	 */
	public int getValue()
	{
		return this.myValue;
	}
	
	/**
	 * Affects a new value to this instance of <code> ObjetNonTrans </code> 
	 * 
	 * @param Type <code>int</code>  represents the new value to affect
	 */
	public void setValue(int newValue)
	{
		this.myValue = newValue;
	}
	
	/**
	 * Returns the name of this instance of <code>ObjetNonTrans</code> 
	 * 
	 * @return Type <code>String</code> representing the name of the object
	 */
	public String getName()
	{
		return this.myName;
	}
	
	/**
	 * Affects a new name to this instance of <code>ObjetNonTrans</code> 
	 * 
	 * @param newName Type <code>String</code> represents the new name to affect
	 */
	public void setName(String name)
	{
		this.myName = name;
	}
}
